import tornado.web
from app import make_app
import tornado.options as options


if __name__ == '__main__':
    #定义命令行参数
    options.define('port', default=8000, type=int,help='bind socket port')
    options.define('host', default='127.0.0.1', type=str , help='设置 host name')

    #解析命令行参数
    options.parse_command_line()

    app = make_app(options.options.host)
    app.listen(options.options.port)
    print('start http://%s:%s'%(options.options.host,options.options.port))
    #启动服务
    tornado.ioloop.IOLoop.current().start()